﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.Observer.IPhoneXPriceDown.Models
{
    /// <summary>
    /// 学生
    /// </summary>
    public class Student
    {
        public string Student_Id { get; set; }

        public string Student_Name { get; set; }

        public int Age { get; set; }

        public string Class_Id { get; set; }

        /// <summary>
        /// 学习
        /// </summary>
        public void Study()
        {
            Console.WriteLine("我要学习了，不要打扰我！");
        }

        /// <summary>
        /// 静态方法
        /// 学习
        /// </summary>
        public static void StudyStatic()
        {
            Console.WriteLine("我要学习了，不要打扰我！");
        }

        /// <summary>
        /// 买IPhoneX
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void Buy(object sender, EventArgs e)
        {
            IPhoneX iPhoneX = (IPhoneX)sender;
            Console.WriteLine($"I am the {nameof(Student)}，This is {iPhoneX.IPhoneX_Version} IPhoneX！");

            IPhoneXEventArgs iPhoneXEventArgs = (IPhoneXEventArgs)e;
            Console.WriteLine($"之前价格{iPhoneXEventArgs.OldPrice}");
            Console.WriteLine($"现在价格{iPhoneXEventArgs.NewPrice}");
            Console.WriteLine("果断买了！");
        }
    }
}
